﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using Common.Background.Entity;
using Common.Background.Data;

namespace Common.Background.Service
{
    public class WebManageUserStrategyService : Service.ServiceBase, IWebManageUserStrategyService
    {
        public WebManageUserStrategyService()
        {
        }

        //查询
        public IQueryable<WebManageUser_Strategy> GetModel()
        {
            return iWebManageUser_StrategyRepository.GetModel();
        }
        public WebManageUser_Strategy GetModel(int id)
        {
            return iWebManageUser_StrategyRepository.GetModel(id);
        }

        //查询所有数据
        public PagedList<WebManageUser_Strategy> WebManageUser_Strategy(VPredication vp, PagingParam pp)
        {
            var linq = iWebManageUser_StrategyRepository.GetModel().Where(n => n.ManageUserID == Convert.ToInt32(vp["ManageUserID"]));
            return new PagedList<WebManageUser_Strategy>(linq.OrderByDescending(n => n.ID), pp.PageIndex, pp.PageSize);
        }

        //添加
        public void InsertStrategy(WebManageUser_Strategy entity)
        {
            iWebManageUser_StrategyRepository.InsertStrategy(entity);
        }

        //修改
        public void UpdateStrategy(WebManageUser_Strategy entity)
        {
            iWebManageUser_StrategyRepository.UpdateStrategy(entity);
        }

    }
}
